﻿-- Author      : Michael de Jong
-- Create Date : 1/5/2012 5:52:24 PM
function Maiks_UI:MaiksLayoutLoad()
	Maiks_UI:MaiksLayoutBottomFrame()
	Maiks_UI:MaiksLayoutTopFrame()
	Maiks_UI:MaiksLayoutRightFrame()
	Maiks_UI:MaiksLayoutHideBliz()
	Maiks_UI:MaiksLayoutMoveBliz()
end

function Maiks_UI:MaiksLayoutBottomFrame()
	MaiksLayoutBottomFrame = CreateFrame("Frame", "DragFrame2", UIParent)
	MaiksLayoutBottomFrame:SetMovable(false)
	MaiksLayoutBottomFrame:EnableMouse(false)
	MaiksLayoutBottomFrame:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 0, 0);
	MaiksLayoutBottomFrame:SetPoint("BOTTOMRIGHT", "UIParent", "BOTTOMRIGHT", 0, 0);
	MaiksLayoutBottomFrame:SetHeight(200);
	MaiksLayoutBottomFrame:SetParent("UIParent")

	local tex1 = MaiksLayoutBottomFrame:CreateTexture("ARTWORK");
	tex1:SetAllPoints();
	tex1:SetTexture(0, 0, 0);  
	tex1:SetAlpha(0.75);
end

function Maiks_UI:MaiksLayoutTopFrame()
	MaiksLayoutTopFrame = CreateFrame("Frame", "DragFrame2", UIParent)
	MaiksLayoutTopFrame:SetMovable(false)
	MaiksLayoutTopFrame:EnableMouse(false)
	MaiksLayoutTopFrame:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 0, 0);
	MaiksLayoutTopFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", 0, 0);
	MaiksLayoutTopFrame:SetHeight(200);
	MaiksLayoutTopFrame:SetParent("UIParent")

	local tex2 = MaiksLayoutTopFrame:CreateTexture("ARTWORK");
	tex2:SetAllPoints();
	tex2:SetTexture(0, 0, 0);  
	tex2:SetAlpha(0.75);
end

function Maiks_UI:MaiksLayoutRightFrame()
	MaiksLayoutRightFrame = CreateFrame("Frame", "DragFrame2", UIParent)
	MaiksLayoutRightFrame:SetMovable(false)
	MaiksLayoutRightFrame:EnableMouse(false)
	MaiksLayoutRightFrame:SetPoint("BOTTOMRIGHT", MaiksLayoutBottomFrame, "TOPRIGHT", 0, 0);
	MaiksLayoutRightFrame:SetPoint("TOPRIGHT", MaiksLayoutTopFrame, "BOTTOMRIGHT", 0, 0);
	MaiksLayoutRightFrame:SetWidth(300);
	MaiksLayoutRightFrame:SetParent("UIParent")

	local tex3 = MaiksLayoutRightFrame:CreateTexture("ARTWORK");
	tex3:SetAllPoints();
	tex3:SetTexture(0, 0, 0);  
	tex3:SetAlpha(0.75);
end

function Maiks_UI:MaiksLayoutHideBliz()
	MainMenuBarLeftEndCap:Hide();
	MainMenuBarRightEndCap:Hide();
	MinimapCluster:Hide();
end

function Maiks_UI:MaiksLayoutMoveBliz()
	Maiks_UI:MaiksLayoutMoveBlizButtons()
	Maiks_UI:MaiksLayoutMoveBlizButtonsResize()
	Maiks_UI:MaiksLayoutMoveBlizUI()
end

function Maiks_UI:MaiksLayoutMoveBlizButtons()
	MultiBarLeftButton1:ClearAllPoints(); 
	MultiBarLeftButton1:SetPoint("BOTTOMLEFT", MaiksLayoutBottomFrame, "BOTTOMLEFT", 5, 5);
	MultiBarLeftButton2:ClearAllPoints(); 
	MultiBarLeftButton2:SetPoint("LEFT", "MultiBarLeftButton1", "RIGHT")
	MultiBarLeftButton3:ClearAllPoints(); 
	MultiBarLeftButton3:SetPoint("LEFT", "MultiBarLeftButton2", "RIGHT")
	MultiBarLeftButton4:ClearAllPoints(); 
	MultiBarLeftButton4:SetPoint("LEFT", "MultiBarLeftButton3", "RIGHT")
	MultiBarLeftButton5:ClearAllPoints(); 
	MultiBarLeftButton5:SetPoint("LEFT", "MultiBarLeftButton4", "RIGHT")
	MultiBarLeftButton6:ClearAllPoints(); 
	MultiBarLeftButton6:SetPoint("LEFT", "MultiBarLeftButton5", "RIGHT")
	MultiBarLeftButton7:ClearAllPoints(); 
	MultiBarLeftButton7:SetPoint("LEFT", "MultiBarLeftButton6", "RIGHT")
	MultiBarLeftButton8:ClearAllPoints(); 
	MultiBarLeftButton8:SetPoint("LEFT", "MultiBarLeftButton7", "RIGHT")
	MultiBarLeftButton9:ClearAllPoints(); 
	MultiBarLeftButton9:SetPoint("LEFT", "MultiBarLeftButton8", "RIGHT")
	MultiBarLeftButton10:ClearAllPoints(); 
	MultiBarLeftButton10:SetPoint("LEFT", "MultiBarLeftButton9", "RIGHT")
	MultiBarLeftButton11:ClearAllPoints(); 
	MultiBarLeftButton11:SetPoint("LEFT", "MultiBarLeftButton10", "RIGHT")
	MultiBarLeftButton12:ClearAllPoints(); 
	MultiBarLeftButton12:SetPoint("LEFT", "MultiBarLeftButton11", "RIGHT")
	MultiBarRightButton1:ClearAllPoints(); 
	MultiBarRightButton1:SetPoint("BOTTOM", "MultiBarLeftButton1", "TOP")
	MultiBarRightButton2:ClearAllPoints(); 
	MultiBarRightButton2:SetPoint("LEFT", "MultiBarRightButton1", "RIGHT")
	MultiBarRightButton3:ClearAllPoints(); 
	MultiBarRightButton3:SetPoint("LEFT", "MultiBarRightButton2", "RIGHT")
	MultiBarRightButton4:ClearAllPoints(); 
	MultiBarRightButton4:SetPoint("LEFT", "MultiBarRightButton3", "RIGHT")
	MultiBarRightButton5:ClearAllPoints(); 
	MultiBarRightButton5:SetPoint("LEFT", "MultiBarRightButton4", "RIGHT")
	MultiBarRightButton6:ClearAllPoints(); 
	MultiBarRightButton6:SetPoint("LEFT", "MultiBarRightButton5", "RIGHT")
	MultiBarRightButton7:ClearAllPoints(); 
	MultiBarRightButton7:SetPoint("LEFT", "MultiBarRightButton6", "RIGHT")
	MultiBarRightButton8:ClearAllPoints(); 
	MultiBarRightButton8:SetPoint("LEFT", "MultiBarRightButton7", "RIGHT")
	MultiBarRightButton9:ClearAllPoints(); 
	MultiBarRightButton9:SetPoint("LEFT", "MultiBarRightButton8", "RIGHT")
	MultiBarRightButton10:ClearAllPoints(); 
	MultiBarRightButton10:SetPoint("LEFT", "MultiBarRightButton9", "RIGHT")
	MultiBarRightButton11:ClearAllPoints(); 
	MultiBarRightButton11:SetPoint("LEFT", "MultiBarRightButton10", "RIGHT")
	MultiBarRightButton12:ClearAllPoints(); 
	MultiBarRightButton12:SetPoint("LEFT", "MultiBarRightButton11", "RIGHT")
	MultiBarBottomLeftButton1:ClearAllPoints(); 
	MultiBarBottomLeftButton1:SetPoint("BOTTOM", "MultiBarBottomRightButton1", "TOP")
	MultiBarBottomLeftButton2:ClearAllPoints(); 
	MultiBarBottomLeftButton2:SetPoint("LEFT", "MultiBarBottomLeftButton1", "RIGHT")
	MultiBarBottomLeftButton3:ClearAllPoints(); 
	MultiBarBottomLeftButton3:SetPoint("LEFT", "MultiBarBottomLeftButton2", "RIGHT")
	MultiBarBottomLeftButton4:ClearAllPoints(); 
	MultiBarBottomLeftButton4:SetPoint("LEFT", "MultiBarBottomLeftButton3", "RIGHT")
	MultiBarBottomLeftButton5:ClearAllPoints(); 
	MultiBarBottomLeftButton5:SetPoint("LEFT", "MultiBarBottomLeftButton4", "RIGHT")
	MultiBarBottomLeftButton6:ClearAllPoints(); 
	MultiBarBottomLeftButton6:SetPoint("LEFT", "MultiBarBottomLeftButton5", "RIGHT")
	MultiBarBottomLeftButton7:ClearAllPoints(); 
	MultiBarBottomLeftButton7:SetPoint("LEFT", "MultiBarBottomLeftButton6", "RIGHT")
	MultiBarBottomLeftButton8:ClearAllPoints(); 
	MultiBarBottomLeftButton8:SetPoint("LEFT", "MultiBarBottomLeftButton7", "RIGHT")
	MultiBarBottomLeftButton9:ClearAllPoints(); 
	MultiBarBottomLeftButton9:SetPoint("LEFT", "MultiBarBottomLeftButton8", "RIGHT")
	MultiBarBottomLeftButton10:ClearAllPoints(); 
	MultiBarBottomLeftButton10:SetPoint("LEFT", "MultiBarBottomLeftButton9", "RIGHT")
	MultiBarBottomLeftButton11:ClearAllPoints(); 
	MultiBarBottomLeftButton11:SetPoint("LEFT", "MultiBarBottomLeftButton10", "RIGHT")
	MultiBarBottomLeftButton12:ClearAllPoints(); 
	MultiBarBottomLeftButton12:SetPoint("LEFT", "MultiBarBottomLeftButton11", "RIGHT")
	MultiBarBottomRightButton1:ClearAllPoints(); 
	MultiBarBottomRightButton1:SetPoint("BOTTOM", "MultiBarRightButton1", "TOP")
	MultiBarBottomRightButton2:ClearAllPoints(); 
	MultiBarBottomRightButton2:SetPoint("LEFT", "MultiBarBottomRightButton1", "RIGHT")
	MultiBarBottomRightButton3:ClearAllPoints(); 
	MultiBarBottomRightButton3:SetPoint("LEFT", "MultiBarBottomRightButton2", "RIGHT")
	MultiBarBottomRightButton4:ClearAllPoints(); 
	MultiBarBottomRightButton4:SetPoint("LEFT", "MultiBarBottomRightButton3", "RIGHT")
	MultiBarBottomRightButton5:ClearAllPoints(); 
	MultiBarBottomRightButton5:SetPoint("LEFT", "MultiBarBottomRightButton4", "RIGHT")
	MultiBarBottomRightButton6:ClearAllPoints(); 
	MultiBarBottomRightButton6:SetPoint("LEFT", "MultiBarBottomRightButton5", "RIGHT")
	MultiBarBottomRightButton7:ClearAllPoints(); 
	MultiBarBottomRightButton7:SetPoint("LEFT", "MultiBarBottomRightButton6", "RIGHT")
	MultiBarBottomRightButton8:ClearAllPoints(); 
	MultiBarBottomRightButton8:SetPoint("LEFT", "MultiBarBottomRightButton7", "RIGHT")
	MultiBarBottomRightButton9:ClearAllPoints(); 
	MultiBarBottomRightButton9:SetPoint("LEFT", "MultiBarBottomRightButton8", "RIGHT")
	MultiBarBottomRightButton10:ClearAllPoints(); 
	MultiBarBottomRightButton10:SetPoint("LEFT", "MultiBarBottomRightButton9", "RIGHT")
	MultiBarBottomRightButton11:ClearAllPoints(); 
	MultiBarBottomRightButton11:SetPoint("LEFT", "MultiBarBottomRightButton10", "RIGHT")
	MultiBarBottomRightButton12:ClearAllPoints(); 
	MultiBarBottomRightButton12:SetPoint("LEFT", "MultiBarBottomRightButton11", "RIGHT")
	ActionButton1:ClearAllPoints(); 
	ActionButton1:SetPoint("BOTTOM", "MultiBarBottomLeftButton1", "TOP")
	ActionButton2:ClearAllPoints(); 
	ActionButton2:SetPoint("LEFT", "ActionButton1", "RIGHT")
	ActionButton3:ClearAllPoints(); 
	ActionButton3:SetPoint("LEFT", "ActionButton2", "RIGHT")
	ActionButton4:ClearAllPoints(); 
	ActionButton4:SetPoint("LEFT", "ActionButton3", "RIGHT")
	ActionButton5:ClearAllPoints(); 
	ActionButton5:SetPoint("LEFT", "ActionButton4", "RIGHT")
	ActionButton6:ClearAllPoints(); 
	ActionButton6:SetPoint("LEFT", "ActionButton5", "RIGHT")
	ActionButton7:ClearAllPoints(); 
	ActionButton7:SetPoint("LEFT", "ActionButton6", "RIGHT")
	ActionButton8:ClearAllPoints(); 
	ActionButton8:SetPoint("LEFT", "ActionButton7", "RIGHT")
	ActionButton9:ClearAllPoints(); 
	ActionButton9:SetPoint("LEFT", "ActionButton8", "RIGHT")
	ActionButton10:ClearAllPoints(); 
	ActionButton10:SetPoint("LEFT", "ActionButton9", "RIGHT")
	ActionButton11:ClearAllPoints(); 
	ActionButton11:SetPoint("LEFT", "ActionButton10", "RIGHT")
	ActionButton12:ClearAllPoints(); 
	ActionButton12:SetPoint("LEFT", "ActionButton11", "RIGHT")
	ActionBarUpButton:ClearAllPoints(); 
	ActionBarUpButton:SetPoint("LEFT", "ActionButton12", "TOPRIGHT", -2, -7)
	ActionBarDownButton:ClearAllPoints(); 
	ActionBarDownButton:SetPoint("LEFT", "ActionButton12", "BOTTOMRIGHT", -2, 7)
	-- Shapeshift/Pally auras
	ShapeshiftButton1:ClearAllPoints(); 
	ShapeshiftButton1:SetPoint("LEFT", "ActionButton12", "RIGHT", 28, 3)
	ShapeshiftButton2:ClearAllPoints(); 
	ShapeshiftButton2:SetPoint("LEFT", "MultiBarBottomLeftButton12", "RIGHT", 28, 2)
	ShapeshiftButton3:ClearAllPoints(); 
	ShapeshiftButton3:SetPoint("LEFT", "MultiBarBottomRightButton12", "RIGHT", 28, 1)
	ShapeshiftButton4:ClearAllPoints(); 
	ShapeshiftButton4:SetPoint("LEFT", "MultiBarRightButton12", "RIGHT", 28, 0)
	ShapeshiftButton5:ClearAllPoints(); 
	ShapeshiftButton5:SetPoint("LEFT", "MultiBarLeftButton12", "RIGHT", 28, -1)
	-- Bags
	MainMenuBarBackpackButton:ClearAllPoints(); 
	MainMenuBarBackpackButton:SetPoint("LEFT", "ActionButton12", "RIGHT", 62, 4)
	CharacterBag0Slot:ClearAllPoints(); 
	CharacterBag0Slot:SetPoint("LEFT", "MultiBarBottomLeftButton12", "RIGHT", 62, 2.5)
	CharacterBag1Slot:ClearAllPoints(); 
	CharacterBag1Slot:SetPoint("LEFT", "MultiBarBottomRightButton12", "RIGHT", 62, 1)
	CharacterBag2Slot:ClearAllPoints(); 
	CharacterBag2Slot:SetPoint("LEFT", "MultiBarRightButton12", "RIGHT", 62, -0.5)
	CharacterBag3Slot:ClearAllPoints(); 
	CharacterBag3Slot:SetPoint("LEFT", "MultiBarLeftButton12", "RIGHT", 62, -2)
	-- MicroButtons
	HelpMicroButton:ClearAllPoints(); 
	HelpMicroButton:SetPoint("BOTTOMRIGHT", MaiksLayoutBottomFrame, "BOTTOMRIGHT", -5, 0);
	MainMenuMicroButton:ClearAllPoints(); 
	MainMenuMicroButton:SetPoint("BOTTOM", "HelpMicroButton", "TOP", 0, -20)
	EJMicroButton:ClearAllPoints(); 
	EJMicroButton:SetPoint("BOTTOM", "MainMenuMicroButton", "TOP", 0, -20)
	RaidMicroButton:ClearAllPoints(); 
	RaidMicroButton:SetPoint("BOTTOM", "EJMicroButton", "TOP", 0, -20)
	LFDMicroButton:ClearAllPoints(); 
	LFDMicroButton:SetPoint("BOTTOM", "RaidMicroButton", "TOP", 0, -20)
	PVPMicroButton:ClearAllPoints(); 
	PVPMicroButton:SetPoint("BOTTOM", "LFDMicroButton", "TOP", 0, -20)
	GuildMicroButton:ClearAllPoints(); 
	GuildMicroButton:SetPoint("BOTTOM", "PVPMicroButton", "TOP", 0, -20)
	QuestLogMicroButton:ClearAllPoints(); 
	QuestLogMicroButton:SetPoint("BOTTOM", "GuildMicroButton", "TOP", 0, -20)
	AchievementMicroButton:ClearAllPoints(); 
	AchievementMicroButton:SetPoint("BOTTOM", "QuestLogMicroButton", "TOP", 0, -20)
	TalentMicroButton:ClearAllPoints(); 
	TalentMicroButton:SetPoint("BOTTOM", "AchievementMicroButton", "TOP", 0, -20)
	SpellbookMicroButton:ClearAllPoints(); 
	SpellbookMicroButton:SetPoint("BOTTOM", "TalentMicroButton", "TOP", 0, -20)
	CharacterMicroButton:ClearAllPoints(); 
	CharacterMicroButton:SetPoint("BOTTOM", "SpellbookMicroButton", "TOP", 0, -20)
end

function Maiks_UI:MaiksLayoutMoveBlizButtonsResize()
	MultiBarLeftButton1:SetScale(0.9); 
	MultiBarLeftButton2:SetScale(0.9); 
	MultiBarLeftButton3:SetScale(0.9); 
	MultiBarLeftButton4:SetScale(0.9); 
	MultiBarLeftButton5:SetScale(0.9); 
	MultiBarLeftButton6:SetScale(0.9); 
	MultiBarLeftButton7:SetScale(0.9); 
	MultiBarLeftButton8:SetScale(0.9); 
	MultiBarLeftButton9:SetScale(0.9); 
	MultiBarLeftButton10:SetScale(0.9); 
	MultiBarLeftButton11:SetScale(0.9); 
	MultiBarLeftButton12:SetScale(0.9); 
	MultiBarRightButton1:SetScale(0.9); 
	MultiBarRightButton2:SetScale(0.9); 
	MultiBarRightButton3:SetScale(0.9); 
	MultiBarRightButton4:SetScale(0.9); 
	MultiBarRightButton5:SetScale(0.9); 
	MultiBarRightButton6:SetScale(0.9); 
	MultiBarRightButton7:SetScale(0.9); 
	MultiBarRightButton8:SetScale(0.9); 
	MultiBarRightButton9:SetScale(0.9); 
	MultiBarRightButton10:SetScale(0.9); 
	MultiBarRightButton11:SetScale(0.9); 
	MultiBarRightButton12:SetScale(0.9); 
	MultiBarBottomLeftButton1:SetScale(0.9); 
	MultiBarBottomLeftButton2:SetScale(0.9); 
	MultiBarBottomLeftButton3:SetScale(0.9); 
	MultiBarBottomLeftButton4:SetScale(0.9); 
	MultiBarBottomLeftButton5:SetScale(0.9); 
	MultiBarBottomLeftButton6:SetScale(0.9); 
	MultiBarBottomLeftButton7:SetScale(0.9); 
	MultiBarBottomLeftButton8:SetScale(0.9); 
	MultiBarBottomLeftButton9:SetScale(0.9); 
	MultiBarBottomLeftButton10:SetScale(0.9); 
	MultiBarBottomLeftButton11:SetScale(0.9); 
	MultiBarBottomLeftButton12:SetScale(0.9); 
	MultiBarBottomRightButton1:SetScale(0.9); 
	MultiBarBottomRightButton2:SetScale(0.9); 
	MultiBarBottomRightButton3:SetScale(0.9); 
	MultiBarBottomRightButton4:SetScale(0.9); 
	MultiBarBottomRightButton5:SetScale(0.9); 
	MultiBarBottomRightButton6:SetScale(0.9); 
	MultiBarBottomRightButton7:SetScale(0.9); 
	MultiBarBottomRightButton8:SetScale(0.9); 
	MultiBarBottomRightButton9:SetScale(0.9); 
	MultiBarBottomRightButton10:SetScale(0.9); 
	MultiBarBottomRightButton11:SetScale(0.9); 
	MultiBarBottomRightButton12:SetScale(0.9); 
	ActionButton1:SetScale(0.9);
	ActionButton2:SetScale(0.9);
	ActionButton3:SetScale(0.9);
	ActionButton4:SetScale(0.9);
	ActionButton5:SetScale(0.9);
	ActionButton6:SetScale(0.9);
	ActionButton7:SetScale(0.9);
	ActionButton8:SetScale(0.9);
	ActionButton9:SetScale(0.9);
	ActionButton10:SetScale(0.9);
	ActionButton11:SetScale(0.9);
	ActionButton12:SetScale(0.9);
end

function Maiks_UI:MaiksLayoutMoveBlizUI()
	Minimap:ClearAllPoints(); 
	Minimap:SetPoint("BOTTOMRIGHT", MaiksLayoutBottomFrame, "BOTTOMRIGHT", -5, 0);
end